<html>
<head>

    <title>Upload Form</title>
    <script type="text/javascript" src="http://cdn.bootcss.com/jquery/1.8.3/jquery.js"></script>
    <script>
        $(document).ready(function(){
            $('#login').click(function(){
                var account = $('input[name=username]').val();
                var password = $('input[name=password]').val();
                $.ajax({
                    'url':'<?php echo site_url("api/helper/login")?>',
                    'type':'post',
                    'data':{'account':account,'password':password},
                    'dataType':'json',
                    'success':function(data){
                        if(data.status){
                            window.location.href = data.data.url;
                        }else{
                            alert('登录失败');
                        }
                    }
                });
            })
        });
    </script>
</head>
<body>


<form action="" method="post">
    <input name="username" type="text">
    <input name="password" type="password">
    <button id="login">登录</button>
</form>
</body>
</html>
